mv $(DISTDIR)/manifest-$(PKG_NAME).in $(PKGDIR)/lib/cargo/manifest.in
install: $(PKGDIR)/lib/cargo/manifest.in
- $(PKGDIR)/install.sh --prefix=$(PREFIX)
+ $(PKGDIR)/install.sh --prefix=$(PREFIX) --destdir=$(DESTDIR)
# Setup phony tasks
.PHONY: all clean distclean test test-unit test-integration libcargo style
CFG_LIBDIR_RELATIVE=lib
flag uninstall "only uninstall from the installation prefix"
+valopt destdir "" "set installation root"
opt verify 1 "verify that the installed binaries run correctly"
valopt prefix "/usr/local" "set installation prefix"
# NB This isn't quite the same definition as in `configure`.
# just using 'lib' instead of CFG_LIBDIR_RELATIVE
-valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
-valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
+valopt libdir "${CFG_DESTDIR}${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
+valopt mandir "${CFG_DESTDIR}${CFG_PREFIX}/share/man" "install man pages in PATH"
+
if [ $HELP -eq 1 ]
then
while read p; do
# Decide the destination of the file
- FILE_INSTALL_PATH="${CFG_PREFIX}/$p"
+ FILE_INSTALL_PATH="${CFG_DESTDIR}${CFG_PREFIX}/$p"
if echo "$p" | grep "^lib/" > /dev/null
then
if [ -z "${CFG_DISABLE_VERIFY}" ]
then
msg "verifying installed binaries are executable"
- "${CFG_PREFIX}/bin/cargo" -h > /dev/null
+ "${CFG_DESTDIR}${CFG_PREFIX}/bin/cargo" -h > /dev/null
if [ $? -ne 0 ]
then
ERR="can't execute installed rustc binary. "